package com.linq.cool.entities;

import com.linq.cool.tree.annotation.TreeChild;
import com.linq.cool.tree.annotation.TreeEntity;
import com.linq.cool.tree.annotation.TreeId;
import com.linq.cool.tree.annotation.TreePid;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: yqlin
 * @Date: 2020/11/24 13:49
 * @Description:
 * @Version: 1.0.0
 */
@TreeEntity
@Data
@Accessors(chain = true)
public class Channel {
    @TreeId
    private Long id;

    private String name;

    @TreePid
    private Long parentId;

    @TreeChild
    private List<Channel> children = new ArrayList<>();

    public Channel(Long id, String name, Long parentId) {
        this.id = id;
        this.name = name;
        this.parentId = parentId;
    }
}
